#include <iostream>
#include <functional>

#include "TcpServer.hpp"
#include "HttpService.hpp"

int main(int argc, char* argv[])
{
    if(argc != 2)
    {
        std::cout << "Usage: processname port" << std::endl;
        return 1;
    }

    HttpService http;
    service_io_t task = std::bind(&HttpService::HanderHttpRequest, &http, std::placeholders::_1);

    uint16_t port = std::stoi(argv[1]);
    Server serv(port);
    serv.Init(task);
    serv.Start();
    serv.Close();


    return 0;
}